package io.github.talelin.latticy.dto.warehouse;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

/**
 * @authoer:wulongbo
 * @createDate:2022/5/10
 * @description:
 */

@Data
@NoArgsConstructor
public class UpdateWareDTO {

    @Length(min = 2, max = 20, message = "{warehouse.length}")
    private String name;

    @Digits(integer=7,fraction=2)
    private BigDecimal size;


    private Integer areaId;

    private Integer province;

    private Integer city;

    private String street;

    private String apartment;

    @Pattern(regexp = "^[1-9]\\d{5}$",
            message = "{postcode.pattern}")
    private String postcode;

    private String description;

    /**
     * 类型：0:标准;1:中转
     */
    private Boolean type;

    /**
     * 0:不可用;1:可用
     */
    private Boolean status;

    private String contactor;

    private String company;

    @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$"
            , message = "{phone.pattern}")
    private String phone;

    @Email(message = "{email}")
    private String email;
}
